package com.david.config.config;

import io.minio.MinioClient;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

//@Configuration
@Data
@Component
public class MinIOConfiguration {
    @Value("${minio.endpoint}")
    private String endpoint;
    @Value("${minio.accesskey}")
    private String accessKey;
    @Value("${minio.serectkey}")
    private String secretKey;


    @Bean
    public  MinioClient minioClient() {
        MinioClient build = MinioClient.builder().endpoint(endpoint).credentials(accessKey, secretKey).build();
        return build;
    }
}
